package com.laoluo.erp.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.laoluo.erp.dao.TradeDAO;
import com.laoluo.erp.domain.Trade;
import com.laoluo.erp.service.TradeService;

@Service
public class TradeServiceImpl implements TradeService {

	private TradeDAO dao;
	
	@Resource(name="tradeDAOImpl")
	public void setDao(TradeDAO dao){
		this.dao = dao;
	}
	
	public void save(Trade trade) {
		dao.save(trade);
	}

	public void delete(Trade trade) {
		dao.delete(trade);
	}

	public void delete(Integer id) {
		dao.delete(Trade.class,id);
	}

	public void update(Trade trade) {
		dao.update(trade);
	}

	public Trade findById(Integer id) {
		return dao.findById(Trade.class, id);
	}

	public List<Trade> findAll() {
		return dao.findAll(Trade.class);
	}
}
